package com.agileai.em.module.expreimbursement.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.agileai.domain.DataParam;
import com.agileai.domain.DataRow;
import com.agileai.em.cxmodule.EmExpReimbursementManage;
import com.agileai.hotweb.bizmoduler.core.StandardServiceImpl;

public class EmExpReimbursementManageImpl
        extends StandardServiceImpl
        implements EmExpReimbursementManage {
    public EmExpReimbursementManageImpl() {
        super();
    }
	@Override
	public List<DataRow> findApproveOpinionRecords(DataParam param) {
		List<DataRow> result = new ArrayList<DataRow>();
		String statementId = sqlNameSpace+"."+"findApproveOpinionRecords";
		result = this.daoHelper.queryRecords(statementId, param);
		return result;
	}
	
	@Override
	public HashMap<String, DataRow> findApproveMobilityRecords(DataParam param) {
		HashMap<String, DataRow> result = new HashMap<String, DataRow>();
		String statementId = sqlNameSpace+"."+"findApproveOpinionRecords";
		result = this.daoHelper.queryRecords("EXP_ACT_INST_ID", statementId, param);
		return result;
	}

	@Override
	public void createApproveRecord(DataParam queryParam) {
		String statementId = sqlNameSpace+"."+"createApproveRecord";
		this.daoHelper.insertRecord(statementId, queryParam);
	}

	@Override
	public void changeStateRecord(DataParam newParam) {
		String statementId = sqlNameSpace+"."+"changeStateRecord";
		this.daoHelper.updateRecord(statementId, newParam);
	}
	@Override
	public String getUserCode(String erPersonId) {
		String statementId = sqlNameSpace+"."+"getUserCodeByUserId";
		DataRow result = this.daoHelper.getRecord(statementId, new DataParam("USER_ID",erPersonId));
		String userCode = result.getString("USER_CODE");
		return userCode;
	}
	
	@Override
	public List<DataRow>  getSelectList(String TypeId) {
		String statementId = sqlNameSpace+"."+"getSelectList";
		List<DataRow> result = this.daoHelper.queryRecords(statementId, new DataParam("TYPE_ID",TypeId));
		return result;
	}
	
}
